package sort;

/**
 * SortEnum
 *
 * @author admin
 * @version 2023/11/02 10:20
 **/
public enum SortEnum {
    BubbleSort(new BubbleSort()) {
        @Override
        public void sort(int[] a) {
            this.sortStrategy.sort(a);
        }
    },
    SelectSort(new SelectionSort()){
        @Override
        public void sort(int[] a) {
            this.sortStrategy.sort(a);
        }
    },
    InsertSort(new InsertSort()) {
        @Override
        public void sort(int[] a) {
            this.sortStrategy.sort(a);
        }
    },
    QuickSort(new QuickSort()) {
        @Override
        public void sort(int[] a) {
            this.sortStrategy.sort(a);
        }
    },
    HeapSort(new HeapSort()) {
        @Override
        public void sort(int[] a) {
            this.sortStrategy.sort(a);
        }
    },
    MergeSort(new MergeSort()) {
        @Override
        public void sort(int[] a) {
            this.sortStrategy.sort(a);
        }
    };
    public SortStrategy sortStrategy;
    SortEnum(SortStrategy sortStrategy) {
        this.sortStrategy=sortStrategy;
    }

    public abstract void sort(int[] a);


}
